package com.example.order.feign;

import com.example.common.core.domain.Result;
import com.example.order.config.FeignConfig;
import com.example.order.feign.fallback.ProductFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(
    name = "product-service", 
    fallback = ProductFeignFallback.class,
    configuration = FeignConfig.class
)
public interface ProductFeignClient {
    
    @PostMapping("/product/{id}/stock/decrease")
    Result<Boolean> decreaseStock(@PathVariable("id") Long productId, @RequestParam("quantity") Integer quantity);
} 